void setup() {

  Serial.begin(9600);
}

void loop() {


  short int ax = analogRead(A0);
  short int temperature = convert_adc2temperature(ax,593,335,10,60);
  Serial.println(temperature);
  delay(500);
}


short int convert_adc2temperature(
   short int ax,
   short int a0,short int a1,
   short int temp0,short int temp1)
{
   short int tempx;
   tempx = temp0+(ax-a0)*(temp1-temp0)/(a1-a0);
   return tempx;
}
